<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><%=ret%></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/webui/style/admin.css" media="all">
    <link rel="stylesheet" href="/webui/style/login.css" media="all">
</head>
<body>

<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2><%=ret%></h2>

        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
            </div>

            <div class="layui-form-item" style="margin-bottom: 20px;" id="slideSubmit"></div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid layui-btn-disabled" lay-submit lay-filter="login" id="login">登 入</button>
            </div>

        </div>
    </div>

    <div class="layui-trans layadmin-user-login-footer">
        <p>© 2020 <a href="http://edroity.com/dragonli">GINI 1.06</a></p>
    </div>

</div>
<script src="/layui/layui.js"></script>
<script>
    layui.config({
        base: '/webui/'  // 模块目录
    }).extend({
        "cosjs":"{/}/layui/?name=cosjs",
        "login":"lib/login",
    }).use(['form','login','slider','cosjs'], function () {
        var form = layui.form,$ = layui.jquery,login = layui.login,slider = layui.slider,cosjs=layui.cosjs;
        let slideSubmit = false;
        let slideValue = cosjs.roll(2,9)*10;
        var sliderOptions = {
            elem : '#slideSubmit',
            step:10,min:0,max:100,showstep:true,range : false,
            change: function(value){ 
                if( value >= slideValue ){  
                    sliderOptions['value'] = value;
                    sliderOptions['disabled'] = true;
                    slider.render(sliderOptions);
                    slideSubmit = true;
                    $("#login").text("登 入").removeClass('layui-btn-disabled').attr("disabled",false)
                }
            }
        }
        $("#login").text("请将圆点滑动到"+JSON.stringify(slideValue)).attr("disabled",true);
        slider.render(sliderOptions);

 

        form.on('submit(login)', function(data){
            if(!slideSubmit){  return;  }
            login(data.field);
            return false;
        })
        if (window!=top){
            top.location.href =window.location.href;
        }
    });
</script>
</body>
</html>